/*
 * All rights Reserved, Designed By DataDriver
 * Copyright:    DataDriver.Inc
 * Company:      Zhuo Wo Infomation Technology (ShangHai) CO.LTD
 */
package com.sun.consumer.controller;


import com.sun.cloudapicommon.entity.SysUser;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;
import java.util.List;

@RestController
public class ConsumerController {
    //单机版
    //public static final String REQUEST_URL = "http://localhost:8001/list";

    //集群版
    public static final String REQUEST_URL = "http://CLOUD-PAYMENT-SERVER";


    @Resource
    private RestTemplate restTemplate;


    @RequestMapping("/find")
    public List<SysUser> findAll() {
        List list = restTemplate.postForObject(REQUEST_URL + "/list", null, List.class);
        return list;

    }
}
